// pages/geren/geren.js
const gerenData = require('../../utils/geren.js')

Page({
  data: {
    list: [],
    msg: []
  },
  
  onLoad: function() {
    this.setData({
      list: gerenData.list,
      msg: gerenData.msg
    })
  },

  handleNavigate(e) {
    const id = e.currentTarget.dataset.id
    wx.navigateTo({
      url: `/pages/detail/detail?id=${id}`
    })
  },
  logout() {
    // 清除本地存储中的用户登录态相关信息
    wx.removeStorageSync('userInfo');
    wx.removeStorageSync('token');
    // 跳转到登录页面（假设登录页面路径为 '/pages/login/login'）
    wx.redirectTo({
      url: '/pages/login/login'
    });
  }
})